﻿namespace FFF.Test.Application.AppServices.PublicService.SignalRs
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Threading.Tasks;
    using Abp.Application.Services;
    using Abp.Auditing;
    using Abp.Dependency;
    using Abp.Json;
    using Abp.Runtime.Caching;
    using Abp.UI;
    using Microsoft.AspNetCore.Http;
    using Microsoft.AspNetCore.Mvc;
    using Microsoft.AspNetCore.SignalR;
    using FFF.Test.Entity;
    using FFF.Test.Entity.FW.View;
    using FFF.Test.Util.Consts;
    using Ydm.Extensions;

    /// <summary>
    /// SignalR的使用
    /// </summary>
    public interface ISignalRAppService : IApplicationService
    {
        /// <summary>
        /// 获取用户的SingleR的ConnectionId
        /// </summary>
        /// <param name="userGUID">用户GUID</param>
        /// <param name="conId">连接的Id</param>
        /// <returns>SignalR对象</returns>
        Task SetUserConId(Guid userGUID, string conId);

        /// <summary>
        /// 移除用户的SingleR的ConnectionId
        /// </summary>
        /// <param name="userGUID">用户GUID</param>
        /// <returns>SignalR对象</returns>
        Task RemoveUserConId(Guid userGUID);

        /// <summary>
        /// 获取用户的ConID
        /// </summary>
        /// <param name="userGUID">用户GUID</param>
        /// <returns>ConId</returns>
        Task<string> GetUserConId(Guid userGUID);

        /// <summary>
        /// 获取用户的ConID
        /// </summary>
        /// <param name="userGUID">用户GUID</param>
        /// <param name="message">发送的信息</param>
        /// <returns>ConId</returns>
        Task<bool> SendMessage(Guid userGUID, string message);

    }
}
